#include "gamemanager.h"
#include "card.h"

void GameManager::PickBanker(MatchRoom::ptr& room)
{
    int num = std::rand() % 3;
    auto it = room->GetPlayers().begin();
    for(int i = 0; i < num; i++)
    {
        it++;
    }
    room->SetBanker((*it));
}

void GameManager::DealCard(MatchRoom::ptr& room)
{
    auto it = room->GetPlayers().begin();
    for(int i = 0; i < 3; i++)
    {
        for(int j = 0; j < 3; j++)
        {

            (*it)->AddCard(CardMgr::GetInstance()->DealCard());
        }
        it++;
    }
}



